// app.js
App({
  onLaunch() {
    console.log('majiao app is start in onLaunch() method!')
    // 展示本地存储能力
    const logs = wx.getStorageSync('logs') || []
    logs.unshift(Date.now())
    wx.setStorageSync('logs', logs)
    const csrfUrl = this.globalData.baseUrl+'api/getcsrf/';
    wx.request({
      url: csrfUrl, //后台API
      data: {
      },
      method:'GET',
      header: {
        'content-type': 'application/json' // 默认值
      },
      success (res) {
        wx.setStorageSync('csrf_token', res.data.csrf_token);
      }
    })
  },
  globalData: {
    isLoggedIn:false,
    restrictedTabIndex:2,
    userInfo: null,
    baseUrl:'http://47.93.84.36:8551/',
    baseUrlStatic:'http://47.93.84.36:8552/'
  },

})
